package cn.ickck.law_paper_final.mapper;

import cn.ickck.law_paper_final.model.entity.GdbBatch;
import cn.ickck.law_paper_final.model.entity.PaBatch;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PaBatchDAO {
    int deleteByPrimaryKey(Integer id);

    int insert(PaBatch record);

    int insertSelective(PaBatch record);

    PaBatch selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(PaBatch record);

    int updateByPrimaryKey(PaBatch record);

    @Select("select count(*) from pa_batch")
    int count();
    @Select("select * from pa_batch limit #{start},#{end}")
    List<PaBatch> selectByPage(int start, int end);

    @Select("select * from pa_batch where name like  CONCAT('%',#{name},'%')")
    List<PaBatch> selectByName(String key);


    @Select("select `key` from pa_batch where id = #{id}")
    String selectKeyById(Integer id);
}